function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
% function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double   vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double   vector of endogenous variables in the order stored
%                                                     in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double   matrix of exogenous variables (in declaration order)
%                                                     for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double   vector of steady state values
%   params        [M_.param_nbr by 1]        double   vector of parameter values in declaration order
%   it_           scalar                     double   time period for exogenous variables for which
%                                                     to evaluate the model
%   T_flag        boolean                    boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = MIU_Pfeifer.dynamic_g1_tt(T, y, x, params, steady_state, it_);
end
g1 = zeros(10, 19);
g1(1,5)=(-y(9));
g1(1,6)=(-y(1));
g1(1,7)=1;
g1(1,1)=(-(y(6)+1-params(2)));
g1(1,8)=1;
g1(1,9)=(-y(5));
g1(1,2)=(-((y(12)-1)/y(11)+1/y(11)));
g1(1,10)=1/y(11);
g1(1,11)=(-y(10))/(y(11)*y(11))-((-(y(2)*(y(12)-1)))/(y(11)*y(11))+(-y(2))/(y(11)*y(11)));
g1(1,12)=(-(y(2)/y(11)));
g1(2,7)=(-1)/(y(7)*y(7));
g1(2,16)=(-((-(y(11)*params(1)*y(17)))/(y(16)*y(17)*y(16)*y(17))));
g1(2,10)=(-((-(y(11)*params(10)))/(y(10)*y(10))));
g1(2,11)=(-(params(1)/(y(16)*y(17))+params(10)/y(10)));
g1(2,17)=(-((-(y(11)*params(1)*y(16)))/(y(16)*y(17)*y(16)*y(17))));
g1(3,5)=(-(params(6)/(y(5)*y(5))));
g1(3,7)=(-1)/(y(7)*y(7));
g1(4,15)=(-(params(1)/y(16)));
g1(4,7)=(-1)/(y(7)*y(7));
g1(4,16)=(-((1+y(15)-params(2))*(-params(1))/(y(16)*y(16))));
g1(5,2)=(-y(12));
g1(5,10)=1;
g1(5,12)=(-y(2));
g1(6,1)=(-(T(1)*y(13)*T(5)));
g1(6,9)=(-(y(13)*T(3)*getPowerDeriv(y(9),1-params(3),1)));
g1(6,13)=(-(T(1)*T(3)));
g1(6,14)=1;
g1(7,5)=1;
g1(7,1)=(-(T(2)*y(13)*(1-params(3))*T(5)));
g1(7,9)=(-(y(13)*(1-params(3))*T(3)*getPowerDeriv(y(9),(-params(3)),1)));
g1(7,13)=(-(T(2)*(1-params(3))*T(3)));
g1(8,6)=1;
g1(8,1)=(-(y(13)*params(3)*1/y(9)*T(6)));
g1(8,9)=(-(y(13)*params(3)*T(6)*(-y(1))/(y(9)*y(9))));
g1(8,13)=(-(params(3)*T(4)));
g1(9,3)=(-(params(8)*1/y(3)));
g1(9,12)=1/y(12);
g1(9,19)=(-1);
g1(10,4)=(-(params(7)*1/y(4)));
g1(10,13)=1/y(13);
g1(10,18)=(-1);

end
